<?php


namespace App\Listeners;

use App\Events\OrderReceive;
use App\Services\OfficialTemplateService;

/**
 * Class OrderReceiveUpdateListener
 * @package App\Listeners
 */
class OrderReceiveNoticeListener
{
    public $order;

    /**
     * Handle the event.
     *
     * @param  OrderReceive $event
     * @return void
     */
    public function handle(OrderReceive $event)
    {
        $this->order = $event->order;

        /** 通知镖师或镖头 */
        $this->doLegwork();
    }

    private function doLegwork()
    {
        info('通知配送单接单');
        //第三方订单不通知
        if(!$this->order->out_trade_no){
            //通知镖师和镖头接单信息
            //OfficialTemplateService::sendReceiveOrder($this->order);
        }

    }
}
